//
//  YZActionSheet.h
//  VET
//
//  Created by YZ on 2018/7/10.
//  Copyright © 2018年 YZ. All rights reserved.
//
#import <UIKit/UIKit.h>

typedef void(^actionBlock)(void);

@class YZActionSheet;

@protocol YZActionSheetDelegate <NSObject>

/**
 点击actionSheet代理方法

 @param actionSheet actionSheet
 @param buttonIndex index
 */
- (void)actionSheet:(YZActionSheet *)actionSheet clickButtonAtIndex:(NSInteger)buttonIndex;


/**
 ActionSheet取消按钮

 @param actionSheet <#actionSheet description#>
 */
- (void)actionSheetCancle:(YZActionSheet *)actionSheet;

@end


#import "YZActionSheetCell.h"

@interface YZActionSheet : UIView

@property (nonatomic, copy) NSMutableArray *actions;
@property (nonatomic, strong,readonly) NSArray *sheetTitleArr;

/**
 圆角效果
 */
@property (nonatomic,assign) BOOL isCorner;

/**
 标题颜色
 */
@property (nonatomic,strong) UIColor *titleColor;

/**
 标题字体
 */
@property (nonatomic,strong) UIFont *titleFont;

/**
 取消按钮颜色
 */
@property (nonatomic,strong) UIColor *cancelTitleColor;

/**
 取消按钮字体
 */
@property (nonatomic,strong) UIFont *cancelTitleFont;

/**
 副标题颜色
 */
@property (nonatomic,strong) UIColor *subtitleColor;

/**
 副标题字体
 */
@property (nonatomic,strong) UIFont *subtitleFont;;

/**
 副标题间隔线颜色
 */
@property (nonatomic,strong) UIColor *lineColor;

/**
 副标题背景色
 */
@property (nonatomic,strong) UIColor *subtitlebgColor;

/**
 标题颜色
 */
@property (nonatomic,strong) UIColor *titlebgColor;

/**
 取消标题按钮颜色
 */
@property (nonatomic,strong) UIColor *canclebgColor;

/**
 标题栏高度
 */
@property (nonatomic,assign) CGFloat titleHeight;

/**
 标题栏 和 sheet副标题 间距
 */
@property (nonatomic,assign) CGFloat topMarginHeight;

/**
  sheet副标题 和 取消按钮 间距
 */
@property (nonatomic,assign) CGFloat bottomMarginHeight;

/**
 副标题栏高度
 */
@property (nonatomic,assign) CGFloat sheetHeight;

/**
 取消按钮高度
 */
@property (nonatomic, assign) CGFloat cancleHeight;

@property (nonatomic, assign) int selectedIndex;

/**
 图标数组,设置样式带图标时需要传入
 */
@property (nonatomic,strong) NSMutableArray *iconArr;

@property (nonatomic,weak) id<YZActionSheetDelegate> delegate;

/**
 创建ActionSheet 如果创建有图标的要传入iconArr参数

 @param title 标题
 @param sheetTitles 选项标题数组
 @param cancleBtnTitle 取消按钮标题
 @param delegate 代理
 */
- (instancetype)initWithTitle:(NSString *)title
                  sheetTitles:(NSArray *)sheetTitles
               cancleBtnTitle:(NSString *)cancleBtnTitle
                   sheetStyle:(YZActionSheetStyle)sheetStyle
                     delegate:(id<YZActionSheetDelegate>)delegate;
/**
 显示actionSheet
 */
- (void)show;
//- (void)showWithView:(UIView *)view;

/**
 视图消失
 */
- (void)dismiss;

#pragma mark - actions

- (void)addAction:(actionBlock)actionBlock;

@end
